<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:extpoint="http://www.ruijie.com.cn/faces/extension">
<head>
	<title>#{orderPrintAction.order.orderFormula.name}----路远生物</title>
	<c:set var="skinPath" value="${facesContext.externalContext.requestContextPath}/skin/default"/>
	
	<link href="${facesContext.externalContext.requestContextPath}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
	<link href="${facesContext.externalContext.requestContextPath}/favicon.ico" rel="bookmark" type="image/x-icon" />
<!--	<link href="#{skinPath}/ui.css" media="screen" rel="Stylesheet" type="text/css" />-->
	<style>
		table{
			border-collapse:collapse;border:1px black solid;
		}
		
		td{
			border:1px solid black;
		}
	</style>
</head>
<body>
	<div style="width: 640px;text-align: center;">
		<h1 style="font-size: 24px;font-weight: bold;">#{orderPrintAction.order.orderFormula.name}</h1>
		<h2 style="text-align: right;font-size: 14px;font-weight: normal;">中国（路远）科学保健中心</h2>
	</div>
	<div style="width: 100%;">
		<table border="1" width="640px">
			<colgroup>
				<col width="100px"/>
				<col width="110px"/>
				<col width="100px"/>
				<col width="120px"/>
				<col width="100px"/>
				<col width="110px"/>
			</colgroup>
			<tbody>
			<tr width="100%">
				<td style="font-size: 14px;font-weight: bold;">姓名</td>
				<td style="font-size: 14px;">#{orderPrintAction.order.delivery.receiver}</td>
				<td style="font-size: 14px;font-weight: bold;">年龄</td>
				<td colspan="3">
					<h:outputLabel value="#{orderPrintAction.order.customer.birthDate}" converter="#{ageConverter}" style="font-size: 14px;"/>
				</td>
			</tr>	
			<tr width="100%">
				<td style="font-size: 14px;font-weight: bold;">电话</td>
				<td style="font-size: 14px;">#{orderPrintAction.order.delivery.deliveryPhone}</td>
				<td style="font-size: 14px;font-weight: bold;">QQ</td>
				<td style="font-size: 14px;">#{orderPrintAction.order.customer.qq}</td>
				<td style="font-size: 14px;font-weight: bold;">性别</td>
				<td>
					<h:outputLabel value="#{orderPrintAction.order.customer.gender}"  style="font-size: 14px;"
						converter="#{messageConverter}" messagePrefix="luyuan_crm_member_memberInfo_" />
				</td>
			</tr>	
			<tr width="100%">
				<td style="font-size: 14px;font-weight: bold;">地址</td>
				<td colspan="3" style="font-size: 14px;">#{orderPrintAction.order.delivery.deliveryAddress.getAddress()}</td>
				<td style="ffont-size: 14px;ont-weight: bold;">籍贯</td>
				<td style="font-size: 14px;">#{orderPrintAction.order.customer.nativePlace}</td>
			</tr>
			<tr width="100%">
				<td style="font-size: 14px;font-weight: bold;">客服</td>
				<td style="font-size: 14px;">#{orderPrintAction.order.support.alias}</td>
				<td style="font-size: 14px;font-weight: bold;">客服电话</td>
				<td style="font-size: 14px;">#{orderPrintAction.order.support.telephone}</td>
				<td style="font-size: 14px;font-weight: bold;">客服qq</td>
				<td style="font-size: 14px;">#{orderPrintAction.order.support.qq}</td>
			</tr>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">订单号</td>
				<td colspan="5" style="font-size: 14px;">#{orderPrintAction.order.id}</td>
			</tr>
			<tr>
				<td colspan="2" style="font-size: 14px;font-weight: bold;">配方执行时间</td>
				<td colspan="4" style="font-size: 14px;">本次配方执行时间为#{orderPrintAction.order.orderFormula.days}天</td>
			</tr>
			</tbody>
		</table>
	</div>
	<div style="width: 640px;margin-top: 20px;">
		<div style="width: 640px;text-align: center;">
			<h1 style="font-size: 24px;font-weight: bold;">配方表</h1>
		</div>
		<table>
			<colgroup>
				<col width="160px"/>
				<col width="480px"/>
			</colgroup>
			<tbody>
			<c:if test="#{not empty orderPrintAction.order.orderFormula.beforeBreakfast}">
			<tr>
				<td style="font-size: 14px;font-weight: bold;">临早餐前</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.beforeBreakfast}" 
					escape="false"  converter="#{htmlConverter}" style="font-size: 14px;"/></td>
			</tr>
			</c:if>
			<c:if test="#{not empty orderPrintAction.order.orderFormula.afterBreakfast}">
			<tr>
				<td style="font-size: 14px;font-weight: bold;">早餐后</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.afterBreakfast}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			</c:if>
			<c:if test="#{not empty orderPrintAction.order.orderFormula.beforeLunch}">
			<tr>
				<td style="font-size: 14px;font-weight: bold;">临午餐前</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.beforeLunch}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			</c:if>
			<c:if test="#{not empty orderPrintAction.order.orderFormula.afterLunch}">
			<tr>
				<td style="font-size: 14px;font-weight: bold;">午餐后</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.afterLunch}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			</c:if>
			<c:if test="#{not empty orderPrintAction.order.orderFormula.beforeDinner}">
			<tr>
				<td style="font-size: 14px;font-weight: bold;">临晚餐前</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.beforeDinner}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			</c:if>
			<c:if test="#{not empty orderPrintAction.order.orderFormula.afterDinner}">
			<tr>
				<td style="font-size: 14px;font-weight: bold;">晚餐后</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.afterDinner}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			</c:if>
			<c:if test="#{not empty orderPrintAction.order.orderFormula.beforeSleep}">
			<tr>
				<td style="font-size: 14px;font-weight: bold;">临睡前</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.beforeSleep}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			</c:if>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">顾客原服用药单</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.oldDrugBill}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">顾客保健要求</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.customerRequire}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">本配方保健目的</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.purpose}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">生活注意事项</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.lifeNote}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">备  注</td>
				<td ><h:outputLabel value="#{orderPrintAction.order.orderFormula.remarks}" 
					escape="false"  converter="#{htmlConverter}"  style="font-size: 14px;"/></td>
			</tr>
			</tbody>
		</table>
	</div>
	
	<div style="width: 640px;margin-top: 20px;">
		<div style="width: 640px;text-align: center;">
			<h1 style="font-size: 24px;font-weight: bold;">产品清单</h1>
		</div>
		<table border="1" width="640px;">
			<tr>
				<td width="160px;" style="font-size: 14px;font-weight: bold;">产品名称</td>
				<td style="font-size: 14px;font-weight: bold;">订购数量</td>
				<td style="font-size: 14px;font-weight: bold;">规格</td>
				<td style="font-size: 14px;font-weight: bold;">价格</td>
				<td style="font-size: 14px;font-weight: bold;">小计</td>
			</tr>
			<ui:repeat var="item" value="#{orderPrintAction.orderProducts}">
				<tr>
					<td style="font-size: 14px;">#{item.name}</td>
					<td style="font-size: 14px;">#{item.count}</td>
					<td style="font-size: 14px;">#{item.specification}</td>
					<td style="font-size: 14px;">#{item.price}</td>
					<td style="font-size: 14px;">#{item.gift ? "赠品" : item.exchangeIntegral ne 0 ? "积分兑换": item.subTotal}</td>
				</tr>
			</ui:repeat>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">总价</td>
				<td  colspan="4" style="font-size: 14px;">#{orderPrintAction.order.amount}</td>
			</tr>
			<tr>
				<td style="font-size: 14px;font-weight: bold;">备注信息</td>
				<td  colspan="4">
					<h:outputLabel value="#{orderPrintAction.order.remarks}" style="font-size: 14px;"
						escape="false"  converter="#{htmlConverter}" />
				</td>
			</tr>
		</table>
	</div>
	
	<div style="width: 640px;">
		<p>注：<br/>
		<h:outputLabel value="#{orderPrintAction.order.orderFormula.note}" converter="#{htmlConverter}" escape="false" style="font-size: 14px;"/></p>
	</div>
	<div style="width: 640px;text-align: right;margin-right: 100px;margin-top: 20px;">
		<h:outputLabel value="#{orderPrintAction.order.createTime}" style="font-size: 14px;"
							datePattern="yyyy-MM-dd" converter="#{dateConverter}" />
	</div>
	<script>
		window.print();
	</script>
</body>
</html>
